<%@ page language="java" import="java.util.*"
	contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<title>后台管理-申请试用</title>
		<link rel="stylesheet" href="/resources/src/css/lib/bootstrap.min.css">
		<link rel="stylesheet" href="/resources/src/css/admin/main.css" />
		<link rel="stylesheet" href="/resources/src/css/admin/user-manage.css" />
    </head>
    <body>
		<article class="main">
			<div class="main-wrapper">
				<section class="content">
					<div class="container">
						<div class="con-body">
							<!-- <div class="toolbar clearfix">
								<div class="toolbar-right pull-left">
									<div class="input-icon">
										<input type="text" id="search" placeholder="输入用户名/手机/邮箱查询"/>
										<i class="iconfont icon-sousuo" id="search-btn"></i>
									</div>
								</div>
							</div> -->
							<div class="user-table table-responsive">
								<table class="table">
									<thead>
										<tr>
											<th>填写人</th>
											<th>备注时间<i id="remarkTime" class="iconfont icon-paixu" data-order="0"></i></th>
											<th>内容</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody>
									<c:forEach items="${pages.result }" var="page">
										<tr data-userId="255">
											<td>${page.user.userName }</td>
											<td>${page.createTime }</td>
											<td>${page.remark }</td>
											<td><a class="delete" value="${page.id }">删除</a></td>
										</tr>
									</c:forEach>
									<tr>
										<td colspan="4"  style="border:0"><jsp:include page="/common/adminPage.jsp" /></td>
										</tr>
									</tbody>
								</table>		
							</div>
						</div>
					</div>
				</section>
			</div>
		</article>
		
		<!-- 删除备注模态框 -->
		<div class="joModal" id="delRemark-modal" data-liffect="fadeIn">
			<div class="joModal-dialog">
				<input type="hidden" id='applyId' value=""/>
				<div class="joModal-content" data-liffect="slideTop">
					<div class="joModal-body">
						<p class="text-tip">是否要删除该备注，删除后不可恢复！</p>
					</div>
					<div class="joModal-footer clearfix">
						<a class="pull-left cancel modal-btn" data-modal="close" >取消</a>
						<a class="pull-left confirm modal-btn" id="deleteRemark">确定</a>
					</div>
				</div>
			</div>	
		</div>
		
		<script src="/resources/src/js/jquery-2.1.4.js"></script>
		<script src="/resources/src/js/jquery.nicescroll.js"></script>
		<script src="/resources/src/js/admin/main.js"></script>
		<script>
			$(function(){
			
			 	
			 	//删除备注前
			 	$(".user-table").on("click",".delete",function(){
			 		$("#applyId").val($(this).attr("value"));
			 		Global.modal("#delRemark-modal","show");
			 	});
			 	
			 	//删除备注
			 	$("#deleteRemark").on("click",function(){
			 		var applyId = $("#applyId").val();
			 		$.ajax({
		 				type:"post",
		 				url:"/admin/agency/deleteAgencyApplyRemark",
		 				async:true,
		 				dataType:"json",
		 				data:{"id":applyId},
		 				success:function(data){
							alert(data.data);
							location.reload();
		 				}
		 			})
			 	});
			});
		</script>
		
 	</body>
</html>